package learningThread.api.commonAndNot;

/**
 * 不加锁则会出现问题
 */
public class TestCommon {

    public static void main(String[] args) {

        MyRunable myRunable = new MyRunable();
        //实现Runnable
        Thread thread1 = new Thread(myRunable);
        thread1.setName("线程共享 1");
        //实现Runnable
        Thread thread2 = new Thread(myRunable);
        thread2.setName("线程共享 2");

        //实现Runnable
        Thread thread3 = new Thread(myRunable);
        thread3.setName("线程共享 3");

        thread1.start();

        thread2.start();

        thread3.start();
    }
}
